import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { i18n, vantLocales } from './i18n'
import { Lazyload } from 'vant';
import 'amfe-flexible'
import './permission'
import 'vant/es/toast/style';
import 'vant/es/dialog/style';
import Particles from "@tsparticles/vue3";
import { loadSlim } from "@tsparticles/slim";
import * as buffer from "buffer";

if (typeof (window as any).global === "undefined") {
    (window as any).global = window;
}
if (typeof (window as any).Buffer === "undefined") {
    (window as any).Buffer = buffer.Buffer;
}

vantLocales(i18n.global.locale.value)
const app = createApp(App)
app.use(Lazyload, {
    lazyComponent: true,
});

app.use(store).use(router).use(i18n).use(Particles, {
    init: async engine => {
        // await loadFull(engine); // you can load the full tsParticles library from "tsparticles" if you need it
        await loadSlim(engine); // or you can load the slim version from "@tsparticles/slim" if don't need Shapes or Animations
    },
}).mount('#app')



